<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>百家乐</title>
<link rel="stylesheet" href="/pc-static/css/bjl.css">
<link rel='stylesheet' type='text/css' href='/css/animation.css'/>
<script type="text/javascript" src="/js/jq.js"></script>
<script type="text/javascript" src="/js/global.js"></script> 
<script type="text/javascript" src="/js/howler.min.js"></script>
<link rel="stylesheet" href="/layui/css/layui.css">
<script src="/layui/layui.js"></script>
<script src="/layui/layui.all.js"></script>


</head>
<style>
	.layui-layer-content{
		padding:10px;
	}
</style>
<body>
	<div class='wappering'>
		<div class="containers">
			<div class="headers">
				<div class='back' onclick="backRoom()"></div>
				<div class='rooming'></div>
				<div class="message">
					<div class='preiod'>
						
					</div>
					<div class="bg_sound">
						<div class="sound rotate"></div>
					</div>
				</div>
			</div>
			<div class="mains">
				<div class='userMessage'>
					<div class="header">
						<span class="arrowLeft"></span>
						<em>百家乐</em>
						<span class="arrowRight"></span>
					</div>
					<div class="content">
						<div class='userId'>
							<span>会员 I D 	</span>
							<input class='userName' value='80849137' />
						</div>
						<div class='userBalance'>
							<span>可用余额</span>
							<input class='balance' value="" />
						</div>
					</div>
				</div>
				<div class='notice'>
					<div class='title'>公告栏</div>
					<div class='content'>
						【亲爱的用户,你好！】
					</div>
				</div>
				
				<div class='YcutDown'>
					<div class='cutDown'></div>
				</div>
				<div class='xianPrint'></div>
				<div class='zhuangPrint'></div>
				<div class='tips'></div>
				
				<div class='xian selected' data-game="xian">
					<div class='Xname'>闲</div>
					<div class='Xratio'>1:1</div>
					<div class='money'></div>
				</div>
				<div class='xianBox'></div>
				<div class='betArea'>
					<ul class="pair">
						<li class="xianPair selected" data-game="xiandui">
							<div class="xianPairName">闲 对</div>
							<div class="xianPairRatio">1:11</div>
							<div class='money'></div>
						</li>
						<li class="perfectPair selected" data-game="wanmeiduizi">
							<div class="perfectPairName">完美对子</div>
							<div class="perfectPairRatio">1:20</div>
							<div class='money'></div>
						</li>
						<li class="randomPair selected" data-game="renyiduizi">
							<div class="randomPairName">任意对子</div>
							<div class="randomPairRatio">1:11</div>
							<div class='money'></div>
						</li>
						<li class="zhuangPair selected" data-game="zhuangdui">
							<div class="zhuangPairName">庄 对</div>
							<div class="zhuangPairRatio">1:11</div>
							<div class='money'></div>
						</li>
					</ul>
					<ul class='size'>
						<li class="small selected" data-game="xiao">
							<div class='smallName'>小</div>
							<div class='smallRatio'>1:1.5</div>
							<div class='money'></div>
						</li>
						<li class="draw selected" data-game="he">
							<div class='drawName' >和</div>
							<div class='drawRatio'>1:8</div>
							<div class='money'></div>
						</li>
						<li class="big selected" data-game="da">
							<div class='bigName'>大</div>
							<div class='bigRatio'>1:0.54</div>
							<div class='money'></div>
						</li>
					</ul>
				</div>
				<div class='zhuangBox'></div>
				<div class='zhuang selected' data-game="zhuang">
					<div class='Zname'>庄</div>
					<div class='Zratio'>1:0.95</div>
					<div class='money'></div>
				</div>
				<div class='systemSound'>
					<div class='onSound'></div>
					<div>系统音效</div>
				</div>
				<div class='help'>
					<div class='question'></div>
					<div>帮助</div>
					
				</div>
				
				<div class='room-div'>
				 	<ul>
				 		<li>001桌</li>
				 		<li>002桌</li>
				 		<li>003桌</li>
				 		<li>004桌</li>
				 		<li>005桌</li>
				 		<li>006桌</li>
				 	</ul>
				 </div>
			</div>
			<div class="footer">
				<div class='jettonArea'>
					<div class='roomSwitch'></div>
					<div class="jetton">
						<ul class="select-jetton">
							<li></li>
							<li></li>
							<li></li>
							<li></li>
							<li></li>
						</ul>
					</div>
				<div class='btn backHall' onclick="backRoom()" style="margin-right: 50px;">返回大厅</div>	
				<div class='btn cancelBet'>重新下注</div>
				<div class='btn confrimBet'>确认下注</div>
			 </div>	
			 <div class='lotterRecord'>
			 	<div class="wanfa">
			 		<span class='red'>庄：</span><em class="zhuangNum red"></em>
			 		<span class='blue'>闲：</span><em class="xianNum blue"></em>
			 		<span class='green'>和：</span><em class="heNum green"></em>
			 		<span class='red'>庄对：</span><em class="zhuangduiNum red"></em>
			 		<span class='blue'>闲对：</span><em class="xinaduiNum blue"></em>
			 		<!-- <span class='white'>局数</span><em class="dataNum white"></em> -->
			 	</div>
			 	<div class="div-box-item">
			 		<div class="history"></div>
			 		<div class="zhuangxianjl"></div>
			 		<div class="sizejl"></div>
			 	</div>
			</div>
			 </div>
		</div>
		
		<div class="game-rule-promptbox" style="display:none;"><div class="grp-box clearfix" style="transform: scale(1) translate(-50%, -50%);"><div class="grp-head">规则说明</div> <div class="grp-body"><div>
			<div class="title">
				简介<span>INTRODUCTION</span></div>
			<div class="content space">
				百家乐源起于意大利，简单的推理和快速运算是百家乐最大特点，因而从十九世纪即为广受欢迎的扑克游戏。</div>
			<div class="line">
				&nbsp;</div>
			<div class="title">
				玩法<span>GAME INSTRUCTION</span></div>
			<div class="content">
				游戏使用8副扑克牌：</div>
			<div class="list">
				<div>
					荷官会派出“庄家”和“闲家”两份牌。</div>
				<div>
					A是1点，2到9的牌面即为点数，K、Q、J、10是0点，加起来等于10也当作是0点；总数9点或最接近9点的一家胜出。</div>
				<div>
					当任何一家起手牌的点数总和为8或9，就称为“天生赢家”，牌局就算结束，双方不再补牌。</div>
				<div>
					您有9种下注选择：闲家、庄家、和局、庄对子、闲对子、任意对子、完美对子、大、小。</div>
				<div>
					派完起手牌，将依补牌规则补1张牌。</div>
			</div>
			<div class="content">
				补牌规则：</div>
			<div class="content red">
				闲家：</div>
			<div class="table">
				<div>
					<div>
						起手牌点数总和</div>
					<div>
						补牌规则</div>
				</div>
				<div>
					<div>
						0</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						1</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						2</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						3</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						4</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						5</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						6</div>
					<div>
						不须补牌</div>
				</div>
				<div>
					<div>
						7</div>
					<div>
						不须补牌</div>
				</div>
				<div>
					<div>
						8</div>
					<div>
						“天生赢家”</div>
				</div>
				<div>
					<div>
						9</div>
					<div>
						“天生赢家”</div>
				</div>
			</div>
			<div class="content red">
				庄家：</div>
			<div class="table">
				<div>
					<div>
						起手牌点数总和</div>
					<div>
						补牌规则</div>
				</div>
				<div>
					<div>
						0</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						1</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						2</div>
					<div>
						须补牌</div>
				</div>
				<div>
					<div>
						3</div>
					<div>
						当闲家补得第三张牌是8，不须补牌；其余则须补牌</div>
				</div>
				<div>
					<div>
						4</div>
					<div>
						当闲家补得第三张牌是0.1.8.9，不须补牌；其余则须补牌</div>
				</div>
				<div>
					<div>
						5</div>
					<div>
						当闲家补得第三张牌是0.1.2.3.8.9，不须补牌；其余则须补牌</div>
				</div>
				<div>
					<div>
						6</div>
					<div>
						当闲家补得第三张牌是0.1.2.3.4.5.8.9，不须补牌；其余则须补牌</div>
				</div>
				<div>
					<div>
						7</div>
					<div>
						不须补牌</div>
				</div>
				<div>
					<div>
						8</div>
					<div>
						“天生赢家”</div>
				</div>
				<div>
					<div>
						9</div>
					<div>
						“天生赢家”</div>
				</div>
			</div>
			<div class="content red">
				闲家起手牌点数为6点或7点，闲家不须补牌 ，此条件下庄家起手牌点数为5或5点以下，庄家必须补第三张牌。</div>
			<div class="line">
				&nbsp;</div>
			<div class="title">
				派彩<span>PAYOFF</span></div>
			<div class="table div-Odds">
				
			</div>
			<div class="list">
				<div>
					和局时，“庄／闲”的下注将退回。</div>
				<div>
					庄对指庄的起手牌为同数字或英文字母。</div>
				<div>
					闲对指闲的起手牌为同数字或英文字母。</div>
				<div>
					任意对子指庄或闲的起手牌为同数字或英文字母。</div>
				<div>
					完美对子指庄或闲的起手牌为同花色且同数字或同花色且同英文字母。</div>
				<div>
					大指当局开牌张数总和5张牌或6张牌为大。</div>
				<div>
					小指当局开牌张数总和4张牌为小。</div>
			</div>
		</div>
		<br>
		</div>
		 <div class="grp-foot"><a href="javascript:;" class="grp-close">a</a></div></div></div>
	</div>
	
	<script type="text/javascript" src="/pc-static/js/bjl.js"></script>
<script type="text/javascript">
	var BG_SOUND; //背景音乐对象
	var Down_SOUND; //倒计时音乐对象
	var BET_START_SOUND; //开始下注音乐对象
	var BET_END_SOUND; //停止下注音乐对象
	var isIphone = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)
	var MUSIC_PATH=""     //地址
	var roomId; //房间号
	var issueNumber;//当期期号
	var COIN_IMG_OBJECT = { 
	   "1": ["5", "10", "20", "50", "200"], 
	   "2": ["50", "100", "500", "1千", "5千"],
	   "3": ["100", "200", "500", "1千", "5千"],
 	   "4": ["100", "1千", "5千", "1万", "5万"],
	   "5": ["1千", "2千", "5千", "1万", "5万"],
	   "6": ["1千", "5千", "1万", "2万", "5万"],
 	 }
	roomId=getUrlParam("roomid")
	$(".rooming").text("00"+roomId+"桌")
	$(".balance").attr("disabled","disabled")
	$(".userName").attr("disabled","disabled")
	//拿到房间号的筹码
	for(i=0;i<5;i++){
		$(".select-jetton li").eq(i).text(COIN_IMG_OBJECT[roomId][i])
	}
	initAutoMusicPlayer()
	// 获取用户的钱和用户的相关信息
	
	var contentLen=$("body").height();
	if(contentLen<876){
		$(".wappering").css('transform','scale(0.92)')
		$(".wappering").css('transform-origin','top')
	}else{
		$(".wappering").css('transform','scale(1)')
	}
	
	  // 获得服务器时间
	   var getCurrentServerTime = function() {
			var urlPath = "/b/bjlLotter.do"
			$.ajax({
				url: urlPath,
				type: "post",
				data: {
					tableNumber: roomId,
				},
				success: function(data) {
					issueNumber = data.data.nextIssueNumber
					//拿到时间，调用自动倒计时
					var curTime=new Date(data.message).getTime(); //当前系统毫秒时间
					var nextTime=new Date(data.data.nextTime).getTime();//下棋开奖时间
					var daojishi =(nextTime-curTime)/1000;  //倒计时时间
					console.log(daojishi,"daojishi的值")
					autoTimeEvent(daojishi)
				},
			})
	   }
	//获取赔率
	var getbaccaratOdds = function(n) {
		var urlPath =  "/b/baccaratOdds.do"
		$.ajax({
			url: urlPath,
			type: "post",
			data: {},
			success: function(data) {
				/**
				 * rebate1 庄家的赔率
				 * rebate2 闲家的赔率
				 * rebate3闲对的赔率
				 * rebate4庄对的赔率
				 * rebate5和局的赔率
				 * rebate6大的赔率
				 * rebate7小的赔率
				 * rebate8完美对子的赔率
				 * rebate9任意对子的赔率
				 */
				$(".Zratio").text(data.data.rebate1)
				$(".Xratio").text(data.data.rebate2)
				$(".xianPairRatio").text(data.data.rebate3)
				$(".zhuangPairRatio").text(data.data.rebate4)
				$(".drawRatio").text(data.data.rebate5)
				$(".bigRatio").text(data.data.rebate6)
				$(".smallRatio").text(data.data.rebate7)
				$(".perfectPairRatio").text(data.data.rebate8)
				$(".randomPairRatio").text(data.data.rebate9)
				var odds = $(".div-Odds")
				var p = "<div>"+
				"	<div>"+
				"		下注组合</div>"+
				"	<div>"+
				"		赔率</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		庄</div>"+
				"	<div id='e-Zhuang'>"+
				"		1 赔 "+data.data.rebate1+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		闲</div>"+
				"	<div id='e-Xian'>"+
				"		1 赔 "+data.data.rebate2+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		和</div>"+
				"	<div id='e-He'>"+
				"		1 赔 "+data.data.rebate5+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		庄对</div>"+
				"	<div id='e-ZhuangDui'>"+
				"		1 赔 "+data.data.rebate3+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		闲对</div>"+
				"	<div id='e-XianDui'>"+
				"		1 赔 "+data.data.rebate4+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		任意对子</div>"+
				"	<div id='e-RenYiDui'>"+
				"		1 赔"+data.data.rebate9+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		完美对子</div>"+
				"	<div id='e-WanMeiDui'>"+
				"		1 赔 "+data.data.rebate8+"</div>"+
				"</div>"+
				"<div>"+
				"	<div>"+
				"		大</div>"+
				"	<div id='e-Da'>"+
				"		1 赔 "+data.data.rebate6+"</div>"+
				"</div>"+
				"<div>"+
					"<div>"+
						"小</div>"+
					"<div id='e-Xiao'>"+
						"1 赔 "+data.data.rebate7+"</div>"+
				"</div>"
				odds.append(p)
			},
		})
	 }
	getbaccaratOdds()
	getCurrentServerTime()
	getUserMoneyNumber()
	

	   //全局变量
	   //期号 
	   var chooseIndex;
	   var currentMark
	   var zhuangXianArray	
	   var xianJiaBu
	   var zhuangJiaBu
	   var xianDianShu
	   var zhuangDianShu
	   var yingResultText
	   var BG_ID
	   var XIAN_SOUND
	   var ZHUANG_SOUND
	   var RESULT_SOUND
	   var ROOM_INDEX
	   var isClick=true
	   var Status=false
	   var isIphone = /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)
	   var wanfaObject = {
			zhuangdui: ".zhuangPair",
			xiandui: ".xianPair",
			he: ".draw",
			xian: ".xian",
			zhuang: ".zhuang",
			large:".big",
			small:".small",
			arbitraryPairsx:".randomPair",
			perfectPairx:".perfectPair"
	   }  
	   var TABLE_NUMBER_OBJECT = {
			"1": "",
			"2": "2",
			"3": "3",
			"4": "4",
			"5": "5",
			"6": "6",
		}	   
	   var COIN_OBJECT = {
			   "1": 0,
			   "2": 0,
			   "3": 0,
			   "4": 0,
			   "5": 0,
	   }
	   var FAKE_COIN_ARRAY = {}
	   
		ROOM_INDEX=ROOM_ID=localStorage.getItem('roomId')
	   var getServerCards = function() {
		   xian = 0.00
			zhuang = 0.00
			xiandui = 0.00
			zhuangdui = 0.00
			he = 0.00
			iii = 0;
		   $("#id-span-xiazhumoney").text(xian+zhuang+xiandui+zhuangdui+he)
			var urlPath = "/b/takeAwayTheAwardData.do"
				var newRequest = {
					url: urlPath,
					type: "post",
					data: {
						tableNumber: roomId,
						issueNumber: issueNumber,
					},
					success: function(data) {
						var newData = JSON.parse(data)
						if(newData.data.winner==null || newData.data.zhuang1==null || newData.data.zhuang2==null){					
							var zhuangxian=setTimeout(function(){						
								if($('#bjllot').length==0){
								clearTimeout(zhuangxian)
								return;
							}
						ajax(newRequest)},1000)
						Status=false
							return;
						}
						Status=true
						zhuangXianArray = newData
						dealServerCards(newData)
					},
				}
				ajax(newRequest)	
				var curlotter=setTimeout(function(){
					if($('#bjllot').length==0){
						clearTimeout(curlotter)
						return;
					}
					$("#notice div").html("null");
					$.ajax({
						url:"/b/findUserMoneyInfo.do",
						type:"post",
						data: {tableNumber: roomid,issueNumber:issueNumber},
						success:function(data){
							var d = data.data;
							if(d!="0"){
								$("#notice div").html(d);
							}
						}
					})
				}, 5000 )
	   }
		// n > 11
		// n > 8
		// n > 5  5请求开奖结果
		// n > 0 	  
		var yingObject = {
				"闲赢": ".xian",
				"庄赢": ".zhuang",
				"和局": ".draw",
				"小": ".mall",
				"大": ".big",
				"闲对": ".xianPair",
				"庄对": ".zhuangPair",
				"完美对子": ".perfectPair",
				"任意对子": ".randomPair",
		}
		var yingMusicObject = {
				"闲赢": "xianWin.mp3",
				"庄赢": "zhuangWin.mp3",
				"和局": "he.mp3",
		}
		
		var i=0
	   // 初始值 60 秒
	    var autoTimeEvent = function(timeNum) {
		   var n = timeNum
		  getMarkInfo(n)
		  getUserMoneyNumber()
		   if (timeNum > 15) {
			   var timeSpan = $(".cutDown")
			   var intervalFirst = setInterval(function() {
				   if (n - 15 > 0) {
					   timeSpan.text(n - 15)
					     $(".tips").text("下注中")
				   } else {
					   timeSpan.text(0)
					    $(".tips").text("发牌中")
				   }
				   if (n == 60) {
					   if($(".systemSound").find(".onSound").length==1){
						   BET_START_SOUND.play() //开始下注的声音 
					   }else{
						   BET_START_SOUND.stop()
					   }
				   }
				   if(15<n && n<=20){
					   if($(".systemSound").find(".onSound").length==1){
						   Down_SOUND.play()
					   }else{
						   Down_SOUND.stop()
					   }
				   }
				   if (n == 1) {
					    $(".class-img-smallCoin").css("bottom","0px")
						$(".money").text("")
						$(".money").hide();
						betsMoney=0;
						setTimeout(function() {
							$(".class-img-smallCoin").remove();
						}, 1000) 
					   drawData()
					   removeHighLightClassAndNumber()//清空上把的点数和高亮的结果 div
					   removeAllCards()			 //移除所有这把的扑克牌 	   
					   clearInterval(intervalFirst)
					  /*  autoTimeEvent(60) */
					   getCurrentServerTime()
				   } else if (n == 4) {
					 if(Status){
					   settingResultDivHighLight()  //结果高亮
					} 
				   } else if (n == 15) { //获取牌的数据  发牌操作
					   if($(".systemSound").find(".onSound").length==1){
						   BET_END_SOUND.play()
					   }else{
						   BET_END_SOUND.stop()
					   }
					    var currentCoin = document.querySelector(".class-img-smallCoin")
					 /*    if (currentCoin != null) {
						   currentCoin.classList.remove("class-img-smallCoin")
					   }	 */
					   createCardsFirst() 
					   // 获得牌的数据
				   }
				   n = n - 1
			   }, 1000)	
		   } else if (timeNum > 9) {//让用户等到我发完4张牌
			   var intervalEventTwoTwo = setInterval(function() {
				   var timeSpan = $(".cutDown")
				   if (n - 15 > 0) {
					   timeSpan.text(n - 15)
				   } else {
					   timeSpan.text(0)
				   }				   
				   if (n == 9) {
					   //展示 4 张牌，正常补牌
				 	   var urlPath = "/b/takeAwayTheAwardData.do"
						$.ajax({
						   url: urlPath,
						   type: "post",
							data: {
								issueNumber: issueNumber,
								tableNumber: roomId,
							},
							success: function(data) {
								/* var newData = JSON.parse(data) */
								zhuangXianArray = data
								notNoralToAddFourCard(data.data)  //直接展示牌，因为用户来晚了		 		
							},
						})
				   }
				   else if (n == 8) {
				     if (xianJiaBu != undefined) {
					  	   addXianJiaCard(xianJiaBu) //闲家补牌
					     }
				     if (zhuangJiaBu != undefined) {
				       var zhuangjia=setTimeout(function(event) {
				    	   addZhuangJiaCard(zhuangJiaBu)  //补庄家的牌
				       }, 500)
				     }							   
				   }
				   else if (n == 1) {
					   $(".class-img-smallCoin").css("bottom","0px")
						$(".money").text("")
						$(".money").hide();
						betsMoney=0;
						setTimeout(function() {
							$(".class-img-smallCoin").remove();
						}, 1000) 
						drawData()
					   removeHighLightClassAndNumber()//清空上把的点数和高亮的结果 div
					   removeAllCards() //移除所有这把的扑克牌
			 		   clearInterval(intervalEventTwoTwo)
			 		  /*  autoTimeEvent(60)	 */
			 		   getCurrentServerTime()
				   }		
				   else if (n == 4) {
					if(Status){
					   settingResultDivHighLight()//赢的结果高亮
					}
				   }
				   n = n - 1
			   }, 1000)				 
		   } else if (timeNum > 6) { // 让用户等到我发完补牌
			   var intervalEventTwo = setInterval(function() {
				   var timeSpan = $(".cutDown")
				   if (n - 15 > 0) {
					   timeSpan.text(n - 15)
				   } else {
					   timeSpan.text(n - 15)
				   }				   
				   if (n == 6) {
					   //展示 4 张牌，正常补牌
				 	   var urlPath = "/b/takeAwayTheAwardData.do"
					   $.ajax({
					   url: urlPath,
					   type: "post",
						data: {
							issueNumber: issueNumber,
							tableNumber: roomId,
						},
						success: function(data) {
							/* var newData = JSON.parse(data) */
							zhuangXianArray = data
							/* notNoralToAddFourCard(data.data)
 */						   /*  var dataArray = data.data.split("@")
						    var zhuangjiaArray = dataArray[0].split(",")
						    var xianjiaArray = dataArray[1].split(",")
						     if (xianjiaArray.length > 4) {
						    	 xianJiaBu = xianjiaArray[3]
						    	 notNoralToAddFiveCard(xianJiaBu)
						     }
						     if (zhuangjiaArray.length > 4) {
						    	 zhuangJiaBu = zhuangjiaArray[3]
						    	 notNoralToAddSixCard(zhuangJiaBu)						    	 
						     }	 */				     
						},
					})
				   }
			       
				   else if (n == 1) {
					   $(".class-img-smallCoin").css("bottom","0px")
						$(".money").text("")
						$(".money").hide();
						betsMoney=0;
						setTimeout(function() {
							$(".class-img-smallCoin").remove();
						}, 1000) 
					   drawData()
					   removeHighLightClassAndNumber() //清空上把的点数和高亮的结果 div
					   removeAllCards() //移除所有这把的扑克牌
			 		   clearInterval(intervalEventTwo)
			 		  /*  autoTimeEvent(60) */
			 		   getCurrentServerTime()
				   }
				   else if (n == 4) {
					   settingResultDivHighLight() //赢的结果高亮
				   }					   	
				   n = n - 1
			   }, 1000)			   			   
		   }else if (timeNum > 4) {// 让用户等着，问你拿数据
			   var flag = false
			   var intervalEventThree = setInterval(function() {
				   var timeSpan = $(".cutDown")
				   if (n - 15 > 0) {
					   timeSpan.text(n - 15)
				   } else {
					   timeSpan.text(0)
				   }				   
				   	   if (!flag) {
					 	   var urlPath = "/b/takeAwayTheAwardData.do"
						   $.ajax({
						   url: urlPath,
						   type: "post",
							data: {
								issueNumber: issueNumber,
								tableNumber: roomId,
							},
							success: function(data) {
								flag = true
								var newData = data
								zhuangXianArray = newData
								 notNoralToAddFourCard(newData.data) 
							    var dataArray = newData.data.split("@")
							    var zhuangjiaArray = dataArray[0].split(",")
							    var xianjiaArray = dataArray[1].split(",")
							     if (xianjiaArray.length > 4) {
							    	 xianJiaBu = xianjiaArray[3]
							    	 notNoralToAddFiveCard(xianJiaBu)
							     }
							     if (zhuangjiaArray.length > 4) {
							    	 zhuangJiaBu = zhuangjiaArray[3]
							    	 notNoralToAddSixCard(zhuangJiaBu)						    	 
							     }							     
							},
						})
				   	   }
					   else if (n == 4) {
						   settingResultDivHighLight()
						  //结果高亮
					   } else if (n == 1) {
						    $(".class-img-smallCoin").css("bottom","0px")
							$(".money").text("")
							$(".money").hide();
							betsMoney=0;
							setTimeout(function() {
								$(".class-img-smallCoin").remove();
							}, 1000) 
						   drawData()
						   removeHighLightClassAndNumber()//清空上把的点数和高亮的结果 div
						   removeAllCards()//移除所有这把的扑克牌
				 		   clearInterval(intervalEventThree)
				 		   /* autoTimeEvent(60)	 */
				 		    getCurrentServerTime()
					   }		
					   n = n - 1
			   }, 1000)	 					   
		   }  else {// 让用户等到下一把
			   var intervalEventFour = setInterval(function() {
				   if (n <= 1) {
					   /*  $(".class-img-smallCoin").css("bottom","0px")
						$(".money").text("")
						$(".money").hide();
						betsMoney=0;
						setTimeout(function() {
							$(".class-img-smallCoin").remove();
						}, 1000) 
					   drawData()
					   removeHighLightClassAndNumber()//清空上把的点数和高亮的结果 div
					   removeAllCards()//移除所有这把的扑克牌*/
					   clearInterval(intervalEventFour) 
					   /* autoTimeEvent(60)  */
					    getCurrentServerTime()
				   } 
				   else {
					   n = n - 1
				   }
				   
			   }, 1000)
		   }
	   }
		 drawData()
		/* createCardsFirst(); */
		/* initAutoMusicPlayer()
		 bindCheckIOmusicEvent()
	    initRoomCoinsAndPath()
		getCurrentServerTime()	
		getUserMoneyNumber()
		bindGameCoinsClickEvent()
		bindgameModeDivEvent()
		setDetailUlData()
		bindCheckBetBtnEvent() */
</script>
</body>
</html>